package com.tiancheng.onecode.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tiancheng.onecode.entity.MemberOrderRefund;
import com.tiancheng.onecode.model.request.admin.QueryOrderRefundReq;
import com.tiancheng.onecode.model.request.admin.RefundOrderReq;
import com.tiancheng.onecode.model.request.admin.StatisticsMerchantOrderReq;
import com.tiancheng.onecode.model.request.admin.StatisticsUserOrderReq;
import com.tiancheng.onecode.model.response.PageInfo;
import com.tiancheng.onecode.model.response.admin.QueryOrderRefundRes;
import com.tiancheng.onecode.model.response.admin.StatisticsMerchantOrderPayRes;
import com.tiancheng.onecode.model.response.admin.StatisticsMerchantOrderRes;
import com.tiancheng.onecode.model.response.admin.StatisticsUserOrderItemRes;
import com.tiancheng.onecode.model.response.api.RefundPreQueryReq;
import com.tiancheng.onecode.trade.notify.RefundResultMsgBO;

import java.util.List;

/**
 * @Author: kellen
 * @Description: 会员订单退款 service
 * @Date: create in 2024/12/23 20:04
 */
public interface IMemberOrderRefundService extends IService<MemberOrderRefund> {

    PageInfo<QueryOrderRefundRes> queryPlatformPage(QueryOrderRefundReq params);

    /**
     * 根据主订单查询退款单列表
     * @param orderId
     * @return
     */
    List<MemberOrderRefund> queryByOrderId(String orderId);

    /**
     * 根据退款单号查询
     * @param refundId
     * @return
     */
    QueryOrderRefundRes queryByRefundId(String refundId);

    /**
     * 统计查询商户交易信息-按天
     * @param statisticsMerchantOrderReq
     * @return
     */
    List<StatisticsMerchantOrderPayRes> statisticsByMerchant(StatisticsMerchantOrderReq statisticsMerchantOrderReq);
    /**
     * 统计查询交易信息-按天
     * @param statisticsMerchantOrderReq
     * @return
     */
    List<StatisticsMerchantOrderPayRes> statisticsByDay(StatisticsMerchantOrderReq statisticsMerchantOrderReq);

    /**
     * 统计查询用户交易信息-按天
     * @param StatisticsUserOrderReq
     * @return
     */
    List<StatisticsUserOrderItemRes> statisticsByUserId(StatisticsUserOrderReq StatisticsUserOrderReq);

    /**
     * 处理退款消息通知
     * @param refundResultMsgBO
     */
    void refundResultHandler(RefundResultMsgBO refundResultMsgBO);

    /**
     * 退款申请
     * @param orderReq
     */
    String refund(RefundOrderReq orderReq);

    /**
     * 查询订单可退款金额
     * @param orderReq
     * @return
     */
    RefundPreQueryReq refundPreQuery(String orderId);
}
